package com.example.prop_logic;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class EquateViewActivity extends Activity {

    @SuppressLint("NewApi")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.activity_equate_view);
        this.getActionBar().setDisplayHomeAsUpEnabled(true);

        // Make sure we're running on Honeycomb or higher to use ActionBar APIs
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            // Show the Up button in the action bar.
            this.getActionBar().setDisplayHomeAsUpEnabled(true);
        }

        Log.d("ourDebug", "Opened Equate View.");
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /** Called when the user clicks the TruthTable button */
    public void equate(View view) {
        // Open the truth table view.
        Log.d("ourDebug", "EQ!!!shift+1");
        Button button = (Button) this
                .findViewById(R.id.go_to_truth_table_button);

        // TODO
        // Set equal/not equal based on truth table values
        button.setText("Equal");
        button.setVisibility(View.VISIBLE);

        // Create the intent to open the truth table.
        // Intent intent = new Intent(this, TruthTableViewActivity.class);

        // this.startActivity(intent);
    }
}